import {get,post} from '@/utils/request'
import axios from 'axios';
//获取医院的药品
export  function getMedicines(data){
    return  get('http://127.0.0.1:8686/api/getMedicines',{medicinesName: data.medicinesName,medicinesClass: data.medicinesClass,pageNum:data.pageNum,pageSize:data.pageSize})
}

//获取供应商
export  function getSuppliers(){
    return  get('http://127.0.0.1:8686/api/Suoolierxianshi',null)
}

//获取批次药品详情
export  function getBatchDetails(data){
    return  get('http://127.0.0.1:8686/api/batchDetails',{batchesOfInventoryId: data})
}
//调价
export  function changePrice(hmrId,newInventoryPrescriptionPrice){
    return  get('http://127.0.0.1:8686/api/changePrice',{hmrId,inventoryPrescriptionPrice:newInventoryPrescriptionPrice})
}

//审核页面入库
export  function auditAndWarehousing(batchesOfInventoryId,type){
    return  get('http://127.0.0.1:8686/api/auditAndWarehousing',{batchesOfInventoryId,type})
}

//库存查询
export  function getInventorys(data){
    return  get('http://127.0.0.1:8686/api/getInventorys',{
        pageNum: data.pageNum,
    pageSize: data.pageSize,
    medicinesName: data.medicinesName
    })
}
//采购页面入库
export  function insertMedicines(data,status,batchesOfInventoryNumber,supplierId,purchaseTradePriceTotle,currentTime){

  

    return  post('http://127.0.0.1:8686/api/insertMedicines',

    { data,status,batchesOfInventoryNumber,supplierId,purchaseTradePriceTotle}
 
    
    )
}
//批次查询
export  function getbatchesOfInventory(data){
    return  get('http://127.0.0.1:8686/api/getbatchesOfInventory',
    {supplierId: data.supplierId,batchesOfInventoryNumber: data.batchesOfInventoryNumber,
    batchesOfInventoryStatus: data.batchesOfInventoryStatus,pageNum: data.pageNum,
    pageSize: data.pageSize,endBatchesOfInventoryDate: data.endBatchesOfInventoryDate,
    beginBatchesOfInventoryDate: data.beginBatchesOfInventoryDate})
}

//批次删除
export  function delInventory(data){
    return  get('http://127.0.0.1:8686/api/delInventory',
    {
        batchesOfInventoryId: data
    })
}


